package com.tk.servlet;

import java.io.IOException;
import java.security.Provider.Service;

import javax.security.auth.message.callback.PrivateKeyCallback.Request;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.xml.registry.infomodel.User;

import com.tk.entity.Hero;
import com.tk.service.HeroService;
import com.tk.service.impl.HeroServiceImpl;

public class updateResumeServlet extends HttpServlet{
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		HttpSession ses = req.getSession();
		Hero hero = (Hero)ses.getAttribute("hero");
		hero.setTeam((String)req.getParameter("team"));
		hero.setHname((String)req.getParameter("hname"));
		hero.setPwd((String)req.getParameter("pwd"));
		hero.setAlias((String)req.getParameter("alias"));
		hero.setAdd((String)req.getParameter("add"));
		hero.setDeeds((String)req.getParameter("deeds"));
		HeroService hSer = new HeroServiceImpl();
		hSer.update(hero);
		req.getRequestDispatcher("/home/resume.jsp").forward(req, resp);
	}
}
